Skip to content

kboot: T6050: internal display hand-off for the firmware-27 DCP driver, opt-in (stacked on #37) - #35

Closed
rolotrealanis98 wants to merge 23 commits into
omacom:integration/aurorafrom
rolotrealanis98:omacom-t6050-display
Closed

rolotrealanis98 wants to merge 23 commits into
omacom:integration/aurorafrom
rolotrealanis98:omacom-t6050-display

Conversation

@rolotrealanis98

@rolotrealanis98 rolotrealanis98 commented Nov 7, 2026 •

Copy link
Copy Markdown

Base: PR-3 (omacom/t6050-gpu). This PR adds four commits. They touch src/firmware.[ch] and the display part of src/kboot.c only, and cherry-pick onto PR-1 or #30 unchanged. Branch: omacom/t6050-display.

The T6050 firmware-27 DCP driver (aurora-silicon/linux #1012, with the 27.3 method table in #1174) adopts the DCP iBoot leaves running, together with its boot-locked DARTs. It has no hand-off marker. It expects the loader to describe the framebuffer, name the DCP firmware and enable the display nodes, and it refuses a firmware-compat it has no table for before it touches the DCP. On integration/aurora, a T6050 boot ends in "unknown compatible, skip display reserved-memory setup" and publishes nothing for the display.

How this fits the J714c: #30 adds nothing for the display either. His DCP runs from the kernel side on 27.2 firmware, with m1n1's T6050 path unchanged. So this PR does nothing for the display unless asked. The exceptions are two fail-soft items that run on every T6050 boot (commit 2 and the read-only log in commit 3); see "Effect on a J714c" below.

  1. firmware: add the 27.2 and 27.3 beta 1 stub iBoot strings. mBoot-20457.41.3 becomes V27_2 (Aura Add an option to disable checksumming if possible AsahiLinux/m1n1#61) and mBoot-20457.60.65.0.1 becomes V27_3B1 (27.2.98.1, the J716s's 26C5035r stub; its DCP firmware is AppleDCP-1317.60.10, SDK 27.3). None of the os_firmware.version users takes a new branch on T6050.

  2. kboot: t6050: reserve the running coprocessors' __OS_LOG segments. iBoot puts the __OS_LOG segment (segment-ranges flags 0xa) of each coprocessor it leaves running into DRAM that m1n1 hands to the OS, and those coprocessors keep writing it. On the J716s that is dcp, dcpext0-3, aop, mtp and auss-cpu0: about 1.1 MiB, all inside the usable RAM.

    • Each segment is reserved no-map from the ADT of every /arm-io device and its nubs.
    • A segment that overlaps an existing reservation is skipped and logged.
    • It is one transaction: if one reservation fails, none is added.
    • T6050 no longer reaches the generic display path. dart-disp0 is locked as before.
  3. kboot: t6050: hand the internal display to the firmware-27 DCP driver. Every T6050 boot reads and logs the state iBoot left the display in, behind exception guards, and writes nothing: the DCP's CPU control and status, the PROTECT registers of dart-dcp and dart-disp0, and the TCR/TTBR of the three streams the ADT gives page tables (DCP SID 23, scanout SID 0, PIODMA SID 16), each compared with the ADT's l1-tt-N.

    The hand-off itself runs only with chosen.asahi,t6050-display=1 and a known OS firmware, and only if all of these hold: the DCP runs, both DARTs are locked, the three streams translate on four-level tables at the ADT's roots, the DT's dcp, DARTs, mailbox and piodma are the ADT's devices, and /vram lies above the OS's RAM. Then it:

    • reserves /vram no-map as framebuffer and gives it to the dcp node and the display subsystem;
    • sets apple,firmware-version and -compat on the dcp node;
    • enables the dcp, its mailbox, both DARTs and the display subsystem.

    It is one transaction: if any step fails, the DT is left as it was. The DARTs are never initialised, walked or shut down. chosen.asahi,t6050-dcp-compat=27.0.0 publishes <27 0 0> instead, for experiments only.

  4. kboot: t6050: publish DCP firmware-compat 27.3.0 for the 27.3 beta 1 stub. The 27.3 beta 1 DCP firmware implements 27.2's interface plus one IOMFB method (A521) and a larger IOMFBSwap. The compat is published as 27.3.0, as 13.5 beta 4 publishes 13.5.0. With a 27.2 stub the compat is the stub's own 27.2.0, which is what a 27.2 kernel table expects.

Why not the T8142 (M5) path: dt_carveout_reserved_regions() and dt_reserve_m5_display_segments() initialise the DCP's DART and translate through it, and kboot_display_handoff.c walks two-level tables. On T6050 the running DCP depends on those DARTs, and their tables are four-level. On the J716s the DCP firmware segments and the DART tables already lie outside the RAM m1n1 publishes, so the only reservations needed are /vram and the __OS_LOG segments.

The names follow omacom's chosen.asahi,* switches. Our stage 2 used chosen.m5,t6050-display for the same code.

Effect on a J714c: the __OS_LOG reservations (commit 2) and the read-only state log (commit 3) run on every T6050 boot. Unarmed, nothing is enabled and no firmware property is written. If the J714c's stub reports mBoot-20457.41.3 (27.2), os_firmware becomes 27.2 instead of unknown.

Testing

MacBook Pro 16-inch, M5 Pro (J716s, Mac17,8), macOS 27.3 beta 1 stub (26C5035r, mBoot-20457.60.65.0.1).

This stack on hardware (2026-11-07): The full stack on #30 (omacom/wdt-keep at 6653bb2, m1n1 v1.6.1-429-g6653bb2, before the review fixes) booted the J716s on the first pass, 74 s to SSH. The DT had no display nodes and chosen.asahi,t6050-display was not set, so the hand-off was present but not armed. The parts that run on every T6050 boot (the __OS_LOG reservations and the read-only state log) ran in that loader, and Linux came up on 18 CPUs with Wi-Fi.

The hand-off itself ran in our own stage 2 (with the GPU hand-off code in the same image). On 2026-11-07:

  • DCP-A (unarmed): __OS_LOG segments reserved (mtp, auss-cpu0, ...). Linux booted, self-test passed. The first boot of the freshly written file fell back once, as about one in four freshly written payloads did that day; the retry booted.
  • DCP-B0 (armed, daily kernel without DRM_APPLE, DT with the display nodes): the log read dcp at 0x48ae00000: CPU_CONTROL 0x10 (running), dart-dcp SID 23, dart-disp0 SIDs 0 and 16: four-level, the ADT's table, reserved 8 coprocessor __OS_LOG segments, dcp handed off: vram 0x10bd15f4000+0x72c4000 reserved as its framebuffer; firmware-version 27.3 beta, firmware-compat 27.3.0. The dcp node was okay in Linux and the panel kept working on simpledrm: pass (twice).
  • DCP-B (armed, kernel with DRM_APPLE and the 27.3 table): same loader lines. The DARTs probe as locked, then apple-dcp ... Incompatible devicetree. That is expected: the panel's apple,bw-scratch was not in that DT yet. The refusal happens before any DCP register access, with no DART fault: pass.

This branch:

Dependencies: aurora-silicon/linux #1012 and #1174 (27.3 IOMFB table and swap layout), plus the J716s display nodes with the panel's apple,bw-scratch.

Questions:

  • @edimoldovan: does your J714c kernel's DCP take apple,firmware-compat from the DT, or does it ignore it? Would a 27.2 hand-off through this path help you, or do you want T6050 to stay unarmed by default as it is here?
  • Should the __OS_LOG reservations also be opt-in? They protect memory the coprocessors keep writing, so I made them unconditional.
  • Your J714c report lists system firmware 20457.60.65.0.1 with macOS 27.2 (26B123). On the J716s, mBoot-20457.60.65.0.1 is the OS firmware of the 27.3 beta 1 stub. What does m1n1 print as "OS FW version" on your machine?

edimoldovan and others added 9 commits November 7, 2026 21:47
kboot_boot programs only the MTP filter on T6050, dapf_init on reg 1 of
dart-mtp at 0x294810000: the firmware's first access is PMGR at
0x28830c000, entry 0 of the ADT dapf-instance-0, and without it the MTP
never sends HELLO. The AOP entry of dapf_init_all points at the block
shared by every DART at 0x2890fc000 and faults with an SError on T6050.

cpu_start_bit uses one bit per CPU index on T6050, as on T8142; the
4*cluster+core layout never releases cores 14-17 of its three 6-core
clusters.

The J714c ADT has nine i2c nodes; the i2c limit of
dt_disable_missing_devs is raised to 16.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- nvme: admit the J714c ADT's 64 KiB nvme window at 0x45dcc0000 with
  nvmmu at 0x41dcc0000 and use the 0x30000 aperture, as for T8140.
- kboot: retain the loader's heap on T6050 as on T8140, so the live
  NVMe session's buffers survive into the next stage.
- nvme: a shutdown path that stops the coprocessor and leaves its
  firmware resident, behind nvme_t6050_stop_coproc (default off, the
  session is preserved for the next stage).

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Cluster table for the M5 Pro/Max: MCPU0 at 0x210e00000, default
P-state 4; the chip shares T8142's P-state register handling and keeps
the firmware voltage, PLL and throttling configuration.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Before starting the next stage on T6050, every USB port is brought up as
for the proxy (power, usb2phy, pipe handler, dwc3 device init) and
flipped to host: usb2phy host bits, gadget stopped, core soft reset,
port capability host, PHY auto-suspend off, pipe handler link detection
forced off (the parking the kernel PHY driver does for a USB 2.0-only
host).

On J714c the first flip never shows a plugged device; the second
shutdown, bring-up and flip shows it at once. usb_t6050_host_prep polls
PORTSC.CCS after each flip (50 ms the first time, 100 ms after that) and
redoes the bring-up and flip up to three times. A port without a device
stays in host mode after the last attempt.

usb_t6050_host_record, called after the display handoff, writes
/chosen/apple,t6050-usbprep with four words per port: attempts, PORTSC
after the prep, PORTSC before the jump, and ms until PORTSC.CCS. It goes
through the new kboot_set_chosen_u32s, which reopens the packed tree
from a copy, since kboot_prepare_dt has packed it. The P_VECTOR path
skips usb_hpm_restore_irqs on T6050.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Generalise dt_set_gpu_t8140 into dt_set_gpu_g17 parameterised by the G17
perf-state shape (count, active states, table count) and the accepted
compatibles, and call it for T6050 (apple,agx-t6050; 14/13/4) as well as
T8140. Fills the OPP table and the four UAT reserved-memory regions from the
ADT and leaves the node enabled when the data validates.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ainload target

A stage 1 with boot= loads the kernel, DTB and initramfs from the ESP
itself, so the secondaries start from the image iBoot loaded and their
locked RVBAR needs no relay. The embedded stage 1 config is the only
source of the USB proxy window, but a valid config also set the
chainload target, and boot= plus chainload= is refused. With boot= set,
the config now only provides the window.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add /arm-io/dart-pmp0 to dapf_entries[] so dapf_init programs the T6050
PMP's DAPF filter. Without it the PMP ASC MMIO window stays fabric-gated
and AP access SYNC-faults. dart-pmp0 is dart,t8110 with a
dapf-instance-0 property, which dapf_init -> dapf_init_t8110 already
handles; the DAPF aperture is reg[1] (0x2841b0000). After
dapf_init("/arm-io/dart-pmp0", 1) the PMP ASC CPU_CONTROL reads cleanly,
where a raw read without the filter faults.

On the FDT path the kernel DT aliases pmp0 to the PMP's DART with
status = okay to match this entry.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ithout its chainload target

A stage 1 that carries its next stage (U-Boot as the kernel payload, with
its devicetree) uses the embedded config for the proxy window only, as
boot= does. The default stage 2 target would otherwise replace the
appended kernel.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stage 1 reads m1n1/boot.bin with its own NVMe driver and hands the ANS
session over live (nvme.adopt=live-rtkit-v1). The ANS firmware takes
its RTKit handshake once per boot, so U-Boot must adopt that session
instead of starting one. Set /chosen/asahi,nvme-adopt for the appended
next stage; U-Boot's T6050 NVMe driver adopts when it is present.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rolotrealanis98 rolotrealanis98 changed the title kboot: T6050: internal display hand-off for the firmware-27 DCP driver, opt-in (stacked on PR-3) kboot: T6050: internal display hand-off for the firmware-27 DCP driver, opt-in (stacked on #37) Nov 7, 2026
@greptile-apps

greptile-apps Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[High impact] No new blocking issue was established in the reviewed changes.

Summary

Adds opt-in T6050 display handoff and recognizes the 27.2 and 27.3 beta 1 firmware strings.

  • T6050 can hand its internal display to Linux when the display switch is set.
  • Linux can adopt the T6050 GPU with its firmware, memory regions, and mailboxes.
  • T6050 can train and hand the N1 Wi-Fi and Bluetooth port to Linux.
  • T6050 starts its secondary CPUs and keeps their hand-off memory reserved.
  • T6050 USB ports are left in USB 2.0 host mode for Linux.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[T6050 display setup] --> B[Reserve coprocessor logs]
    B --> C[Read display state]
    C --> D{Display switch enabled?}
    D -- No --> E[Keep display nodes unchanged]
    D -- Yes --> F{Firmware, hardware and tree checks pass?}
    F -- No --> E
    F -- Yes --> G[Save device tree]
    G --> H[Publish framebuffer and firmware; enable nodes]
    H --> I{All edits succeed?}
    I -- Yes --> J[Keep edited tree]
    I -- No --> K[Restore saved tree]
Loading

Reviews (5) · Last reviewed commit: "kboot: t6050: give the display nodes a p..." · Reviewed by Greptile

Comment thread src/usb.c Resolved
Comment thread src/pcie_t6050.c Resolved
Comment thread src/smc.c Resolved
@rolotrealanis98

Copy link
Copy Markdown
Author

Thanks. Of the findings here:

None of the display commits in this PR changed.

@rolotrealanis98

Copy link
Copy Markdown
Author

Pushed one more commit, ffee101 "kboot: t6050: give the display nodes a phandle if the DT has none".

The hand-off re-finds the display nodes by phandle. dtc only emits a phandle for a node some property references, and the in-tree J716s DT labels dcp and display_subsystem but only extends them (&dcp { ... }), so the DTB built from the kernel tree has no phandle on either. On that DTB this branch logged "a display node has no phandle: no handoff" and booted without the display hand-off; our stage-2 variant of the same check bailed into the proxy instead and the stage-1 watchdog reset the machine, which is how we found it. The fix gives any display node without a phandle a new one (inside the save/restore transaction, highest offset first so the remaining offsets stay valid) and logs it.

Tested on the J716s: with the fix, the in-tree DTB boots with the DCP driving the panel (apple-drm, eDP-2, six native timings, no IOMFB timeouts) next to the GPU. Earlier "tested on the J716s" claims for this branch were made with a DTB that happened to carry the phandles.

edimoldovan and others added 13 commits November 8, 2026 08:47
On T6050 the USB host flip runs after kboot_prepare_dt() reserved the
retained heap and after chainload_image() set the next stage's
top_of_kernel_data. Its dwc3 bring-up allocates DART tables, which can
extend the heap past that boundary, so the next stage could reuse memory
the USB DART still points at.

Right before the jump, kboot_retain_late_heap() reserves the heap added
since the reservation, and chainload_retain_late_heap() raises the staged
top_of_kernel_data over the heap added since the staging. When the late
reservation fails, m1n1 returns to the proxy, as the display handoff does.

Tested on J714c: stage 2 with this change (m1n1-aurora 1.6.1.aurora22-104)
boots from disk into Omarchy, 22 of 22 feature checks pass.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Six host tests compile production bodies that aurora-silicon#30 extends for T6050
and stop compiling or matching on its head:
- test_nvme_adoption and test_smp_handoff_gate: nvme_init() and
  kboot_boot() now name T6050, and kboot_boot() calls dapf_init().
  Define T6050 and stub dapf_init() beside the existing stubs.
- test_smp_handoff_gate also compiles kboot_prepare_dt(), which since
  140a36b sets retained_heap_end. Declare it.
- test_m3_defaults_optout: payload_run() names T6050 for the live ANS
  session hand-off. Define it.
- test_universal_boot: the stage 1 config block now reads boot_spec and
  kernel (an appended next stage takes only the proxy window). Declare
  both, and add the cases aurora-silicon#30 introduces: with boot_spec or an appended
  kernel set, a configured target adds neither a chainload target nor
  its ESP hint, and a chainload= line is kept rather than refused. T6050
  joins the chip list of the configured-target cases.
- test_chainload_run_base compiles chainload_image(), which since 140a36b
  keeps the staged boot_args and heap high-water in file statics. Declare
  them beside the other model state.
- test_t8103_inherited_reservation ends its block at the T8140 heap
  check, which is now "T8140 || T6050" with a comment line before it.
  Match both forms.

integration/aurora passes all six before and after; on aurora-silicon#30's head
they fail without this.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
iBoot locks the RVBAR of every T6050 secondary to the base of the image
it loaded, stage 1. A stage 2 with a kernel appended (about 38 MiB) does
not fit between that base and the secondary-only CTRR window that ends
at top_of_kernel_data (about 12 MiB on a J716s), so a stage 1 that puts
it above the window runs it at another address. Its secondaries then
reset into the retired stage 1's vectors, smp_prepare_rvbar() refuses
every start, and kboot disables CPUs 1-17 ("is not alive").

On T6050, rewrite slot 0 of that vector table, once, with the stub
start.S already writes at a moved M3 image's old base ("ldr x16, 1f;
br x16; 1: .quad _vectors_start"); T8140's single branch can be out of
reach at this distance. Only a table with our four slot tags, in RAM
below this image and outside the CTRR window, at EL2, is rewritten, and
kboot reserves its 16K page so a core reset later still finds the relay.
The write and read-back are shared with the T8140 relay, whose behaviour
is unchanged.

tests/python/test_smp_legacy_rvbar.py now builds the shared helper,
and a new case runs the T6050 relay: it is written once, read back, and
refused without a write outside EL2, for a foreign table, inside the
CTRR window, above this image or below RAM, for an unlocked RVBAR and
on other SoCs.

Tested on the J716s (MacBook Pro 16-inch, M5 Pro): our stage 2, chainloaded
above the CTRR window by our A/B stage 1, has started all 18 CPUs every
day since 2026-11-04 through the same forwarding stub.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
The protocol-27 centauri driver and pcie-apple's T6050 adoption need from
the boot loader what only the ADT knows. For the apple,t6050-pcie host:

- the N1 control function (pci106b,1900) gets firmware-name
  "apple/centauri/<target-type>-ftab.bin", apple,centauri-platform-id
  (board-id << 16 | chip-id) and apple,centauri-protocol 27, each only if the DT leaves it
  unset;
- each apple,link-trained-by-bootloader root port gets the ADT
  pci-bridge<n> config, rc and gen3/4/5 shadow tunables as
  (offset, 4, mask, value) groups, which Linux replays in the root-port
  reset of the N1's post-ROM port cycle;
- each such root port and the DART its endpoint maps to are enabled only
  if the port meets the adoption's preconditions: root complex running,
  port ready, link up and not retraining, LTSSM on, an Apple endpoint,
  no RID route yet, the endpoint's command bits clear and the DART's
  protection and stream registers still 0 (the root port's buses are
  numbered if they are 0). Otherwise both stay disabled, since the DART
  of a port that is not up takes an SError when Linux probes it.

The MAC addresses already travel through the wifi0/bluetooth0 aliases.
Nothing here trains a link.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
Port Aura's measured T6050 GP-port bring-up (aurora-silicon/aura PR
aurora-silicon#60/aurora-silicon#61, src/pcie_t6050.c, Jeff Queisser) to the J716s N1 on apcie0
port 0: the GP power closure and the shared GP PHY (stages A and S, only
while no GP port has a link), then the port's reset table, config
tunables, reset handshake, Gen3 x1 DBI policy, lane PHY, PERST# and
LTSSM (B-E), the bus numbers and the endpoint's ID (F, 106b:1900 or
1901) and Linux's adoption preconditions (G). Every address comes from
the ADT (apcie0 reg[16..21], pci-bridge0, gpio0, dart-apcie0).

Storage (ANS, NVMe, its SART and power) is compared with a reference
before and after each stage that touches shared state. A failed check
before the training only refuses it; a change after a stage, or after
a stage that stopped partway (checked again on every stop once the
reference is taken), returns N1_STORAGE_LOST, and kboot_setup_n1() then resets the SoC through the
watchdog after 15 s instead of booting a kernel that may not mount its
root. Any other stop leaves port 0 and its DART disabled, even if the
link came up (a stage G failure).

It only runs when the payload sets chosen.asahi,t6050-n1=1; =2 also
writes the N1's reset release through the SMC first (pci-bridge0
function-reset: pKW4 "gP13", template 0x00800000, written as
template | 1). adt_getprop_copy() returns the copied length, so the
function-reset descriptor is taken only when the whole descriptor was
copied.

Adds pmgr_psreg_by_name(), and makes pmgr_power_is_on() skip virtual
devices: T6050 has a no_ps APCIE_PHY_SW beside the real one. Adds
tunables_check_local_addr() (Aura's read-back with per-record strobe
bits excused), and kboot_get_chosen(), kboot_chosen_param() for the
other kboot files.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
…sahi,t6050-n1=3|4)

On a boot chain whose chainloading stage-1 reads boot.bin from the ESP
and then stops ANS (as the J716s A/B stage-1 does), the stage-2 m1n1
finds ANS stopped, and the storage reference of the port-0 training
refuses before any write ("STOP: ANS is not running (before)":
/arm-io/ans reg[0] + 0x44, CPU control RUN bit 4, reads 0).

With chosen.asahi,t6050-n1=3 (=4 with the SMC reset release of =2),
stage-2 starts ANS with nvme_init(), reads NVMe block 1 (the GPT
header), runs the =1/=2 training with storage live as designed, then
requires the same storage registers and the same block read again, and
stops ANS again with the new nvme_stop(). If storage is in doubt, it
resets the SoC through the watchdog after 15 s instead of booting a
kernel that could not mount its root. With ANS already running, =3/=4
train as =1/=2, with the same fatal handling of a storage change.

nvme_stop() is nvme_shutdown() without the post-M4 hand-off: on M4 and
later nvme_shutdown() disables the controller but leaves ANS, its RTKit
session and its SART-mapped buffers live for a later stage to adopt.
Here nothing adopts them: Linux's nvme-apple boots a stopped ANS
itself, and the buffers would sit in RAM that Linux sees as free while
the firmware still owns them. nvme_stop() goes on to the M1-M3 teardown
(RTKit sleep, ANS reset, SART and queues freed), which is what the
tested J716s boots ran.

rtkit_boot()'s HELLO and endpoint-map wait becomes settable (1 s by
default, as before); the training sets 10 s around nvme_init(), as
Linux waits for this ANS (it can take about 3 s to answer after a stop).

Like the training itself, this runs once per boot: a second kboot
preparation gets the first result and leaves ANS alone.

=1 and =2 are unchanged.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>

# Conflicts:
#	src/nvme.c
…ahi,t6050-n1=2|4)

The J716s ADT's /arm-io/apcie0/pci-bridge0 function-reset is phandle
654 (the SMC PMU nub), "pKW4", key "gP13", template 0x00800000: the
descriptor Aura's J813 code uses. Release the N1's reset as J813 does
(aurora-silicon/aura 21c3f70, src/j813_n1.c): write template | 0,
wait 50 ms, template | 1, wait 50 ms, shut the SMC client down, then
100 ms before the port reset table; the link-up wait becomes 1 s. The
SMC's RTKit boot gets the same 10 s HELLO/endpoint-map wait as ANS.

On the J716s, =4 brings the link up at Gen1 x1 with the N1 (106b:1900)
at 01:00.0; without the pulse (=3) the link did not come up in 500 ms.
=1 and =3 are unchanged (same register sequence, 500 ms link wait).

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
…i,t6050-n1=2|4)

A restart from a boot with the N1 trained and in use resets the SoC but
not the N1: it keeps running its firmware with the SMC's gP13 left
released. On the J716s, a loader without this change hangs once on that
warm N1 (the stage 1 watchdog then boots the fallback payload), and m1n1
had never seen that state.

With the SMC release (=2, =4):
- print the entry state of port 0 (link status, LTSSM control, PERST#
  pad) and what gP13 reads before the pulse;
- a port that still has a link is parked first: LTSSM off, PERST#
  asserted, link down within 100 ms, or STOP "link down after PERST#";
- if gP13 reads released (template | 1), hold the reset 250 ms instead
  of 50 ms;
- the endpoint must then answer in its ROM personality (106b:1900);
  106b:1901 means the N1 kept running, and the training stops instead
  of handing it to Linux.
=1 and =3 still adopt a live link and accept 106b:1901, as before.

The SMC client gets bounded waits: a command, and the initialisation,
ends with "SMC: no reply" if its reply has not come 2 s after it was
sent, however much other traffic (notifications) arrives meanwhile (it
used to spin forever, also on an RTKit receive error), and
smc_read_u32() reads a key of up to 4 bytes.

Tested on the J716s (MacBook Pro 16-inch, M5 Pro) with the same change
on our stage 2: three systemctl reboot cycles with wlan0 associated and
a ping running all came back on the primary slot with the N1 adopted.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
aurora-silicon/linux's G17 driver (apple,agx-g17s) adopts the M5 Pro
GPU as iBoot leaves it: both coprocessor images loaded but not started,
and the UAT set up. It needs that state as reserved memory, and the two
coprocessor mailboxes at their native windows. dt_set_gpu() has no
T6050 case yet ("ADT: GPU: unsupported chip!").

Add dt_set_gpu_t6050(), beside the G17 fill that aurora-silicon#30 adds for
apple,agx-t6050. dt_set_gpu() picks it when the gpu node is
apple,agx-g17s and keeps the G17 fill for every other T6050 gpu node.
It runs only if that node is enabled in the device tree, and takes
everything from the ADT of this boot:
 - uat-handoff, uat-l2-pagetables, uat-pagetables, uat-ttbs: /arm-io/sgx
   gfx-handoff, gfx-shared-l2-region, gfx-shared-region, gpu-region;
 - gpu-fw-text: gfx-asc __TEXT through gfx1-asc __TEXT, and gpu-fw-data:
   gfx-asc __DATA through gfx1-asc __DATA_SHARED_RO, from segment-ranges.
   Each must be contiguous, and the data segments must lie at the sgx
   gfx{,1}-data{,-shared-ro}-base addresses. The images sit elsewhere
   under another iBoot build on the same J716s, so nothing is hardcoded;
 - the wrapper and iop-vbar windows of each mailbox the gpu node names,
   from the coprocessor whose ADT role is the mailbox's
   apple,firmware-role, once the mailbox's interrupts are checked to be
   that coprocessor's. The mailboxes are enabled with the GPU.
The gpu node's sgx window must be the ADT's. The regions are checked
(non-zero, 16 KiB aligned, below 4 TiB, no overlaps) and published
last, through dt_set_resvmem(). Anything unexpected disables the gpu node, its
mailboxes and the regions published so far, and the boot goes on. No
GPU register is read or written.

There is no chosen.* opt-in. As for T8140 and the G17 fill, the device
tree that comes with the kernel decides whether the GPU is used; the opt-ins
in this file guard GPU register access (the G15 identity probes and
power stand-ins), which this does not do.

The two do not overlap: the J716s ADT's sgx has perf-state-table-count
2, where the G17 fill takes 4 (the J714c's), and the g17s driver keeps
its own operating points.

Tested on the J716s with the same fill on our stage 2 behind an opt-in
(E2b, firmware 27.3 26C5035r): the G17 driver probes, both InitData
are acknowledged and the DRM device registers; Vulkan and GL (on zink)
render, and Hyprland runs on the GPU.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
On the J716s the 27.3 beta 1 stub (26C5035r) reports
mBoot-20457.60.65.0.1, which is not in the table, so os_firmware is
"unknown" and m1n1 publishes no usable firmware version for anything
that needs one. Add it as V27_3B1 (27.2.98.1, the usual beta numbering)
and the 27.2 stub's mBoot-20457.41.3 as V27_2.

Of the os_firmware.version users, none takes a new branch on T6050:
the GPU path takes dt_set_gpu_t6050() before its firmware switch,
the ISP and iBoot DCP paths only match older versions, and the 26.6.2
checks (J613, payload ranking) do not match.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
iBoot puts the __OS_LOG segment (segment-ranges flags 0xa) of every
coprocessor it leaves running in DRAM that m1n1 then hands to the OS,
and those coprocessors keep writing it. On a J716s with the 27.3 beta 1
stub that is dcp, dcpext0..3, aop, mtp and auss-cpu0, about 1.1 MiB at
0x10006020000..0x10006126514, all inside the usable RAM m1n1 publishes.
Nothing reserves them on T6050 today, so Linux can hand those pages to
anything.

Reserve each one, no-map, by physical address, from the ADT of every
/arm-io device and its nubs. A segment that overlaps a /memreserve/
entry or another reservation is left alone and logged. The reservations
are one transaction: if one cannot be added, none is. Nothing is written
to the hardware. kboot_display_handoff.c reserves only the dcp and
dcpextN logs, as part of its per-SoC handoff, so T6050 does not go
through it.

T6050 also no longer reaches the generic display path, which ends in
"unknown compatible" for it; dart-disp0 is locked as before.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
The T6050 firmware-27 DCP driver (aurora-silicon/linux #1012) adopts
the DCP iBoot leaves running and its boot-locked DARTs. It has no
handoff marker: it expects the loader to describe the framebuffer, name
the DCP firmware and enable the display nodes, and it refuses a
firmware-compat it has no method table for at probe, before it touches
the DCP. Neither integration/aurora nor aurora-silicon#30 does any of this for
T6050.

On every T6050 boot, read the internal display as iBoot left it and log
it: the DCP ASC's CPU control and status, the PROTECT of dart-dcp and
dart-disp0, and the TCR/TTBR of the three streams the ADT gives page
tables (DCP SID 23 on dart-dcp, scanout SID 0 and PIODMA SID 16 on
dart-disp0) against the ADT's l1-tt-N. Every read is exception-guarded
and nothing is written. dart-disp0 is locked after this read, as
before, so the log shows iBoot's own state.

With the boot.bin config line chosen.asahi,t6050-display=1, and only when
the OS firmware is known, the DCP runs, both DARTs are locked, the three
streams translate on four-level tables at the ADT's roots, the DT's
dcp, DARTs, mailbox and piodma are the ADT's devices and /vram lies
above the OS's RAM: reserve /vram no-map as "framebuffer", give it to
the dcp node and the display subsystem as their "framebuffer"
memory-region, set apple,firmware-version and -compat on the dcp node
from the stub's firmware, and enable the dcp, its mailbox, both DARTs
and the display subsystem. The edit is one transaction: if any step
fails the DT is left as it was. The DARTs are never initialised, walked
or shut down here.

chosen.asahi,t6050-dcp-compat=27.0.0 publishes <27 0 0> as the compat
instead. That claims an interface the 27.3 firmware was not built for
and is only for experiments.

Tested on the J716s with the same hand-off on our stage 2 (under the
name chosen.m5,t6050-display): the dcp, its mailbox, both DARTs and the
display subsystem are enabled with /vram as the framebuffer, and the
27.3 DCP driver probes to its devicetree check without a DART fault.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
…stub

apple,firmware-compat names the DCP interface the kernel has to speak.
The 27.3 beta 1 stub (mBoot-20457.60.65.0.1) published its own version,
27.2.98.1, which no driver table describes. Its DCP firmware
(AppleDCP-1317.60.10) implements one interface: 27.2's with one more
IOMFB method at A521 and a larger IOMFBSwap. Publish that as 27.3.0, as
13.5 beta 4 publishes 13.5.0. apple,firmware-version stays the stub's.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
The display hand-off finds the dcp, the display subsystem, both display
DARTs and the mailbox again by phandle, because every property it adds
moves the offsets of the nodes after it, and it gave up with "a display
node has no phandle: no handoff" when one had none.

dtc writes a phandle only for a node some property references with
<&label>. A J716s DT that extends &dcp and &display_subsystem but does
not reference them compiles to a DTB with no phandle on either (the
DARTs and the mailbox have one, from iommus and mboxes), so the
hand-off never ran: the dcp stayed disabled and the framebuffer
unreserved, with the display driver then finding nothing to adopt.

A loader should not need the DT to reference a node. As the first step
of the hand-off's DT transaction, give each of the five nodes that has
no phandle a new one (fdt_generate_phandle, set as "phandle"), from the
highest offset down: a property added to a node moves only the nodes
after it, so the offsets still to be used stay valid. The transaction
restores the DT if a later step fails, new phandles included.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
@rolotrealanis98

Copy link
Copy Markdown
Author

Rebased onto 140a36b with no change; the hand-off never initialises a DART, and its temporary DT copies are simply swept into #30's late-heap reservation.

@greptile-apps

greptile-apps Bot commented Nov 8, 2026

Copy link
Copy Markdown

Want your agent to iterate on Greptile's feedback? Try greploops.

@rolotrealanis98

Copy link
Copy Markdown
Author

The M5/T6050 loader work now lands in aurora-silicon/aura, the m1n1-based loader the J716s boots through, so I am closing this stack here. Superseded: the T6050 internal display hand-off for the firmware 27 DCP driver lives in aura's kboot_display_handoff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants